<template>
  <div>
      <van-field label="账号" v-model="username"/>
      <van-field label="密码" v-model="password"/>
      <van-button @click="login">登录</van-button>
  </div>
</template>

<script>
import axios from '../../http/axios'
export default {
data () {
    return {
        username:'',
        password:'',
        role_id:1,
        userid:1
    }
},
methods: {
    login(){
        axios('/log','post',{'role_id':this.role_id}).then(res=>{
            console.log(res)
            localStorage.setItem('url_list',JSON.stringify(res.list))
            localStorage.setItem('userid',this.userid)
            this.$router.push('/show_lst')
        })
    }
},
mounted () {
    
}
}
</script>

<style>

</style>